package com.ran.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ran.sys.entity.UserStatus;
import com.ran.sys.entity.Userinfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StatusMapper extends BaseMapper<UserStatus> {

    public List<UserStatus> getUserStatus();

    @Select("SELECT COUNT(DISTINCT username)FROM record  WHERE TO_DAYS(`nowtime`) = TO_DAYS(NOW()) AND statuss='成功'")
    public int successSum();

    @Select("SELECT  COUNT(*)FROM user")
    public int peopleSum();

    @Select("SELECT  COUNT(*)FROM record WHERE TO_DAYS(`nowtime`) = TO_DAYS(NOW()) ")
    public int recordSum();

    @Select("SELECT COUNT(*)FROM record  WHERE TO_DAYS(`nowtime`) = TO_DAYS(NOW()) AND statuss='失败'")
    public int failSum();
}
